<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="content-script-type" content="text/javascript"/>
<meta name="version" content="neblog-1.0"/>
<title>hikerwu</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/tool.js"></script>
<style>
    .dataout { width:100%; height:660px;overflow-x:scroll;}
</style>
</head>
<body>

<div>
    <p><button onclick="if (event.keyCode==13) getUrl(this.value);">gengxin</button></p>
    <table id="tlist">
    </table>
</div>
<script type="text/javascript">

$().ready(function(){
    $("#data_in").focus();
    $("#data_out").hide();
    $("[id='a_go']").click(function(){
        window.open($(this).attr("href"), "_blank");
    });
    $("[id='b_hide']").live('click', function(){
        var obj = this;
        $(obj).attr( "disabled", true );
        var id = $(this).attr("sid");
		var data = {id:id};
        var url = '/hiker/?m=House&a=hide';
        getUrlAndDo( data, url, function( result ) {
			window.location.reload(true);
		});
    });
    var id = $("#data_in").val();
    if(  id != '' ) {
        getUrl( id );
    }
});

function getUrl( id )
{
	$("button").attr("disabled", true );
    var data = {};
    var url = '/hiker/?m=House&a=get';
	getUrlAndDo( data, url, function(result){
        $("#tlist").html("");
		var b = $('<tr>'
		+'<th width="200px">图片</th>'
		+'<th width="600px">标题</th>'
		+'<th width="200px" style="text-align:center">时间</th></tr>');
		$("#tlist").append(b);
        for( var i in result['data'] ) {
            var b = $('<tr id="'+"data_"+i+'">'
			+'<td><img src="'+result['data'][i]['img']+'"/></td>'
			+'<td><u id="a_go" style="color:blue;cursor:pointer" href="'+result['data'][i]['url']+'">'+result['data'][i]['info']+'</u></td>'
			+'<td style="text-align:center"><label>'+result['data'][i]['time']+'</label></td>'
			+'<td><button id="b_hide" sid="'+result['data'][i]['id']+'">消失</label></td>'
			+'</tr>');
            $("#tlist").append(b);
        }
    });
}
</script>

</body>
</html>
